chore(Data/Finsupp): make mapDomain_congr congr#39575
Conversation
PR summary f034c03164Import changes for modified filesNo significant changes to the import graph Import changes for all files
|
8867e7c to
3899098
Compare
|
This pull request has conflicts, please merge |
9a4c77d to
458cedf
Compare
|
This pull request has conflicts, please merge |
1589a31 to
882c618
Compare
|
|
||
| @[simp] | ||
| theorem repr_reindex : (b.reindex e).repr x = (b.repr x).mapDomain e := | ||
| theorem repr_reindex : (b.reindex e).repr x = (b.repr x).equivMapDomain e := |
There was a problem hiding this comment.
This makes the simp set more confluent. Otherwise simp fails to prove reindexFinsetRange_repr because the new congr lemma allows it to simplify the inside of the expression further earlier
| -- The linter complains that `mapDomain_id` can be proved from `mapDomain_fun_id` and `id_eq` | ||
| -- but this isn't true (at least within most of mathlib) |
There was a problem hiding this comment.
Why isn't this true? It looks to me like the congr lemma would eta-expand id, which leads to that chain.
There was a problem hiding this comment.
(I wonder if simp high would be more appropriate to silence the linter)
There was a problem hiding this comment.
I already tried simp high and simp\d a while ago and neither worked to silence the linter.
There was a problem hiding this comment.
Can you elaborate on "this isn't true (at least within most of mathlib)"?
There was a problem hiding this comment.
@[to_fun mapDomain_fun_id]
lemma mapDomain_id : mapDomain id v = v := sum_single _
/--
info: -- Found 0 errors in 41 declarations (plus 22 automatically generated ones) in the current file with 15 linters
-- All linting checks passed!
-/
#guard_msgs in
#lint
but if I do it with import Mathlib, then it complains. I tried bisecting quickly and I seem to be able to import most of mathlib without complaining
There was a problem hiding this comment.
Sorry, I misdiagnosed and you are perfectly right. simp\d does silence the linter as expected.
There was a problem hiding this comment.
Let me be clearer; I think that perhaps this lemma should not be tagged simp at all, precisely for the reason that the linter says? What proofs break if this is not simp?
joneugster
left a comment
There was a problem hiding this comment.
Thanks, LGTM!
maintainer merge
|
🚀 Pull request has been placed on the maintainer queue by joneugster. |
|
Any final comments from Eric? bors d=@eric-wieser |
|
✌️ eric-wieser can now approve this pull request until 2026-08-05 16:44 UTC (in 2 weeks). To approve and merge, reply with
|
|
I was hoping to look further at #39575 (comment) but haven't found the time yet. |
I just resolved this comment, so hopefully Eric is happy with it now? |
This makes simp stronger. It particular, it breaks some proofs that relied on simp being weak.
From MeanFourier